using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

using Kypris2.CoreElements;
using Jamila2.CoreElements;
using Jamila2.Tools;

namespace GonzalesCore.CoreElements
{
    public enum TypeOfCreditCardPayment { PaidByCompany, PaidByEmployee }

    public class CreditCardItem : ElementBase
    {
        public TypeOfCreditCardPayment PaymentType = TypeOfCreditCardPayment.PaidByCompany;        

        public string CardNumber = "";
        public string EmployeeNumber = "";
        public string TransactionCode = "";
        public DateTime TransactionDate = DateTime.MinValue;
        public string Description = "";
        public Currency SpentCurrency = null;
        public decimal SpentAmount = 0;
        public Currency FinalCurrency = null;
        public decimal FinalAmount = 0;
        public decimal ExchangeRate = 0;
        public bool IsSelected = false;
        public bool IsDuplicated = false;

        public string AttachedToClaimHeaderID = "";
        public string AttachedToClaimDetailID = "";
        public GonzalesClaimHeader AttahcedToClaimHeader = null;
        public GonzalesClaimItem AttahcedToClaimDetail = null;

        public CreditCardItem()
            : base()
        {
            this.internal_id = SwissArmy.UniqueID();
        }

        public CreditCardItem(string InternalID)
            : base(InternalID)
        {
        }
    }

    public class CreditCardItems : CollectionBase
    {

        public CreditCardItem this[int index]
        {
            get
            {
                return ((CreditCardItem)List[index]);
            }
            set
            {
                List[index] = value;
            }
        }

        public int Add(CreditCardItem value)
        {
            return (List.Add(value));
        }

        public int IndexOf(CreditCardItem value)
        {
            return (List.IndexOf(value));
        }

        public void Insert(int index, CreditCardItem value)
        {
            List.Insert(index, value);
        }

        public void Remove(CreditCardItem value)
        {
            List.Remove(value);
        }

        public bool Contains(CreditCardItem value)
        {
            // If value is not of type Int16, this will return false.
            return (List.Contains(value));
        }
    }    
}
